package b_openApi管理.a_重置API调用次数;

import a_接口调用凭证.a_获取接口调用凭据.GetAccessToken;
import my.wechat.rc.common.HttpClientUtil;
import my.wechat.rc.common.MapUtil;

/**
 * @author 86153
 * @date 2022/7/29
 **/
public class ClearQuota {

    public static ClearQuotaResponse clearQuota() {
        try {
            String url = "https://api.weixin.qq.com/cgi-bin/clear_quota?access_token=" + GetAccessToken.getAccessToken().getAccessToken();
            return HttpClientUtil.post(url, MapUtil.of("appid", GetAccessToken.appid), ClearQuotaResponse.class);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return new ClearQuotaResponse();
    }

    public static void main(String[] args) {
        clearQuota();
    }

    public static class ClearQuotaResponse {
        private Integer errcode;
        private String errmsg;

        public Integer getErrcode() {
            return errcode;
        }

        public void setErrcode(Integer errcode) {
            this.errcode = errcode;
        }

        public String getErrmsg() {
            return errmsg;
        }

        public void setErrmsg(String errmsg) {
            this.errmsg = errmsg;
        }
    }

}
